<meta charset="utf-8" />
<div class="box" id="biz_bizpointDim_lookback_conatainer" >
       <div class="box-header with-border" style="max-width: 1200px;" >
               <form id="searchbackForm" role="form" class="form-inline">
                     <div class="form-group">
                         <label>聚合维度名称</label>
                         <input name="name"  v-model="searchForm.name"  v-bind:value="searchForm.name"  type="text" placeholder="" class="form-control input-sm">
                    </div>
                     <button type="button"  class="btn btn-info pull-right m-t-n-xs" v-on:click="search"><strong>查询</strong></button>
                </form>
            </div>
	<div class="box-body">
				<div class="btn-group " id="bizpointDimToolbar" role="group">
				<button type="button" class="btn btn-default" v-on:click="confirm">
                        <i class="glyphicon glyphicon-ok" aria-hidden="true"></i>确认
                 </button>
                 <button type="button" class="btn btn-default" v-on:click="cancel">
                        <i class="glyphicon glyphicon-remove" aria-hidden="true"></i>取消
                 </button>                   
				</div>
				<table id="bizpointDimtablex" data-mobile-responsive="true"></table>
	</div>

	<script type="text/javascript">
	var newa=new Vue({  
		  el: '#biz_bizpointDim_lookback_conatainer', 
		  data:{
			  searchForm:{
				  isIn: 0,
				  bizpointId: null,
				  name: null,
			  },
		    	bus:new Vue()
		  },
		   mounted:function(){
				 var _this=this;
				 var param = zfesLayerEditDg.getCallBackParam();
				 var bizpointId=param.bizpointId;
				 _this.searchForm.bizpointId=bizpointId;
				_this.initTable();
			  },
	    methods: {
	  	  initTable:function(){
	  		var _this=this;
	  		 var columns=[
					{checkbox:true,width:16},
					{field:'name',title:'聚合维度名称',width:160,sortable:true,formatter: _this.formatLink},
					{field:'status',title:'聚合维度状态',width:60,formatter:_this.formatStatus},
					{field:'remark',title:'备注',width:160}];
			  var url="/agg/admin/dimension/loadDimensionDataSet";
	    		zfesBstable.vueLoadTable($("#bizpointDimtablex"),$("#bizpointDimToolbar"),url,columns,this.searchForm);
	  	  },
	  	  search:function(){
	  		  zfesBstable.reload($("#bizpointDimtablex")); 
	  	  },
	  	  confirm: function(){
	  		if (zfesBstable.isSelectedRow($("#bizpointDimtablex"))) {
	  			var _this=this;
				var ids = zfesBstable.getRowIds($("#bizpointDimtablex"));
				var ajaxUrl="/agg/admin/bizpoint/addDimsToBiz";
				zfesAjax.ajaxTodo(ajaxUrl, { "dimIds" : ids,"id":_this.searchForm.bizpointId}, function(data) {
					alertSwal.successText(data.message);
					zfesLayerEditDg.close();
				});
			}
	  	  },
	  	cancel: function(){
	  		zfesLayerEditDg.close();
	  	 }
	   } 
	});
</script>
</div>